Unmatched ‘]’
Description
PHP has encountered a closing parenthesis, but has no related opening parenthesis.
In more complex situations, there might be opening and closing parenthesis: this error reports that there are more closing ones than opening. Eventually, some will not have a matching bracket.
Inside double-quoted strings, the unmatched closing brackets are ignored, and used as literal value.
Example
<?php
$a[1 + 2 = 3;
// One too many parenthesis
if (in_array(foo(), array()))) { doSomething(); }
?>
Alternatives
- Remove the closing curly bracket.
- Add an opening closing curly bracket.
Related error messages
- unclosed-‘(’
- unmatched-‘}’
- unmatched-‘)’
- [unclosed-‘(’-does-not-match-‘]’](unclosed-(-does-not-match-].html)
- syntax-error,-unexpected-string-content